package hr.controller;

import hr.dao.impl.EmployeeDaoImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;

/**
 * Created with IntelliJ IDEA.
 * User: VMoskalenko
 * Date: 13.07.12
 * Time: 13:26
 */
@Controller
public class EmployeeListController {

    @Autowired
    private EmployeeDaoImpl employeeDao;

    @RequestMapping(value = "/employee/list", method = RequestMethod.GET)
    public String list(HttpServletRequest request) {
        request.setAttribute("employeeList", employeeDao.all());
        return "employee_list";
    }

}
